var $ = require('jquery');
registController.$inject = ['authService','$location','$rootScope','$scope'];

function registController(authService,$location,$rootScope,$scope) {

//   var vm = $scope.vm;
//   vm.inconformity= false;
//   vm.inconformity=true;
//   vm.how_type = 2;
    var vm = $scope.vm = {
        inconformity:false,
        show_error: true,
        show_type: 2
    };

    vm.regist=function(){
        var form =document.getElementById("basic_form");
        var fd=new FormData(form);
        authService.regist(
            fd
        ).then(function (data) {
            // console.log(authService.sendToAdmin(data.data));
            $location.path("/login");
        });
    }

    vm.pwdCheck = function(){
        var cpwd = $('#cpwd').val();
        var recpwd = $('#recpwd').val();
        if(cpwd==recpwd){
            vm.inconformity = false;
        }else{
            vm.inconformity = true;
        }
    }
}

module.exports = registController;